# 作者    : 周  文  俊
# 编写时间 :2024/10/12  10:32
from django.conf.urls.static import static
from django.urls import path
from . import views
from gradulation import settings

urlpatterns = [
    path('article/', views.article_list, {'tag_type': None}, name='article'),
    # 匹配没有 page_type 的情况
    path('article/<str:tag_type>/', views.article_list, name='article_with_type'),
    path('detail/<int:page_id>/', views.detail, name='detail'),
    path('', views.to_article, name='redirect'),
    path('submit_comment/<int:page_id>/', views.submit_comment, name='submit_comment'),
    path('delete_comment/<int:comment_id>/', views.delete_comment, name='delete_comment'),
    path('like_comment/<int:comment_id>/', views.like_comment, name='like_comment'),
    path('search/', views.search, name='search'),
    path('login/', views.user_login, name='login'),
    path('logout/', views.user_logout, name='logout'),
    path('register/', views.RegisterView.as_view(), name='register'),
    path('user/', views.user_center, name='user'),
    path('delete_essay/<int:essay_id>/', views.delete_essay, name='delete_essay'),
    path('edit_essay/<int:essay_id>/', views.edit_essay, name='edit_essay'),
    path('submit_essay/', views.submit_essay, name='submit_essay'),
    path('change_message/', views.change_message, name='change_message'),










    # 与本次项目无关的url
    path('form1/', views.form1),
    path('form2/', views.form2),
    path('form3/', views.form3),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
